<style>
    .basicinfo {
        margin: 15px 0;
    }

    .basicinfo .row > .col-xs-4 {
        padding-right: 0;
    }

    .basicinfo .row > div {
        margin: 5px 0;
    }
    #p-images li{
        width: 100%  !important;
    }

</style>
<div id="content-container" class="container">
    <div class="row">
        <div class="col-md-3">
            {include file="common/sidenav" /}
        </div>
        <div class="col-md-9">
            <div class="panel panel-default">
                <div class="panel-body">
                    <h2 class="page-header">
                        {$title}
                        <a href="javascript:;" class="btn btn-primary btn-add  pull-right"><i class="fa fa-plus"></i> {:__('添加作品')}</a>
                    </h2>
                    <div class="row">
                        <table class="table  table-hover">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>作品图片</th>
                                <th>作品名称</th>
                                <th>作者</th>
                                <th>尺寸</th>
                                <th>年代</th>
                                <th>材料</th>
                                <th>添加时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="dataList" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td><img src="{$vo.images}" alt="作品图片" width="50" height="50"></td>
                                <td>{$vo.name}</td>
                                <td>{$vo.author}</td>
                                <td>{$vo.size}</td>
                                <td>{$vo.yeard}</td>
                                <td>{$vo.materials}</td>
                                <td>{$vo.createtime}</td>
                                <td>
                                    <a href="javascript:;" class="btn btn-success btn-edit " data-id="{$vo.id}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
                                    <a href="javascript:;" class="btn btn-danger btn-del  " data-id="{$vo.id}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
                                </td>
                            </tr>
                            {/volist}
                            <!-- 其他行... -->
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="addtpl">
    <style>
        /* 设置输入框的占位符文本颜色为红色 */
        input::placeholder {
            color: red !important;
        }
    </style>
    <form id="resetpwd-form" class="form-horizontal form-layer" method="POST" action="{:url('api/user/saveWorks')}">
        <div class="form-body">
            <input type="hidden" name="types" value="{$type}"/>
            <input type="hidden" name="id" value=""/>
            <div class="form-group" data-type="author">
                <label for="author" class="control-label col-xs-12 col-sm-3">{:__('作者')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input type="text" class="form-control" id="author" name="author" value="" data-rule="required" placeholder="请输入作者">
                    <span class="msg-box"></span>
                </div>
            </div>
            <div class="form-group" data-type="name">
                <label for="name" class="control-label col-xs-12 col-sm-3">{:__('作品名称')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input type="text" class="form-control" id="name" name="name" value="" data-rule="required" placeholder="请输入作品名称">
                    <span class="msg-box"></span>
                </div>
            </div>
            <div class="form-group" data-type="images">
                <label for="images" class="control-label col-xs-12 col-sm-3">{:__('上传作品')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <div class="input-group">
                        <input id="c-images" class="form-control" size="50" name="images" type="text"  placeholder="点击右侧按钮上传">
                        <div class="input-group-addon no-border no-padding">
                            <span><button type="button" id="faupload-images" class="btn btn-danger faupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                        </div>
                        <span class="msg-box n-right" for="c-images"></span>
                    </div>
                    <ul  class="row list-inline faupload-preview" id="p-images"></ul>
                </div>
            </div>
            <div class="form-group" data-type="size">
                <label for="size" class="control-label col-xs-12 col-sm-3">{:__('尺寸')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input type="text" class="form-control" id="size" name="size" value="" data-rule="required" placeholder="请输入尺寸。格式为高×宽，单位为cm，例如：50cmX68cm">
                    <span class="msg-box"></span>
                </div>
            </div>
            <div class="form-group" data-type="yeard">
                <label for="yeard" class="control-label col-xs-12 col-sm-3">{:__('年代')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input type="text" class="form-control" id="yeard" name="yeard" value="" data-rule="required" placeholder="请输入作品创作年代">
                    <span class="msg-box"></span>
                </div>
            </div>
            <div class="form-group" data-type="materials">
                <label for="materials" class="control-label col-xs-12 col-sm-3">{:__('材料')}:</label>
                <div class="col-xs-12 col-sm-8">
                    <input type="text" class="form-control" id="materials" name="materials" value="" data-rule="required" placeholder="请输入作品创作材料">
                    <span class="msg-box"></span>
                </div>
            </div>
        </div>
        <div class="form-group form-footer">
            <div class="col-xs-12 col-sm-8 col-sm-offset-3">
                <button type="submit" class="btn btn-md btn-primary">{:__('Ok')}</button>
            </div>
        </div>
    </form>
</script>
